module.exports = {
    //js和css静态资源使用相对路径
    publicPath: process.env.NODE_ENV === 'production' ? "././" : "./",
    // 输出文件目录
    outputDir: 'dist',
    devServer: {
        port: 8002,
        historyApiFallback: true,
        noInfo: true,
        proxy: {
            '/api': {
                //是否允许跨域
                changeOrigin: true,
                target: 'http://m.tnblog.net/api/v1/home/1',
                pathRewrite:{
                    '^/api':''
                }
            },
            '/myapi': {
                //是否允许跨域
                changeOrigin: true,
                target: 'http://localhost:8081',
                pathRewrite: {
                    '^/myapi':''
                }
            }
        }
    }
}
